import Vue from 'vue'
import Vuex from 'vuex'
import { getItem, setItem } from '@/utils/storage'
Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    user: getItem('TOKEN-USER'),
  },
  mutations: {
    setToken(state, Token) {
      state.user = Token // 页面赋值
      setItem('TOKEN-USER', Token) //存储在本地
    },
  },
  getters: {},
  actions: {},
})

export default store
